Skip to content

[Fix] Environment updates delete unrelated settings when agents revise setup - #2430

Draft
roomote-roomote[bot] wants to merge 1 commit into
developfrom
fix/preserve-environment-config-34pp5gart9i3l
Draft

[Fix] Environment updates delete unrelated settings when agents revise setup#2430
roomote-roomote[bot] wants to merge 1 commit into
developfrom
fix/preserve-environment-config-34pp5gart9i3l

Conversation

@roomote-roomote

Copy link
Copy Markdown
Contributor

​Opened on behalf of @mrubens. View the task or mention @roomote-roomote for follow-up asks.

Related issue

Internal product report; no public issue.

Why this PR exists

  • A maintainer explicitly invited this PR in the linked issue or discussion
  • I am a maintainer / this is internal Roomote work

An agent updating an existing environment could derive a fresh minimal definition from repository evidence and silently delete unrelated persisted settings. The update API replaces the complete definition, but neither the environment setup workflow nor the tool schema made that destructive omission behavior explicit.

What changed

  • Require environment setup runs to treat the complete existing definition as the update baseline and apply only requested or validation-backed changes.
  • Explicitly preserve unrelated instructions, skills, environment variables, MCP servers, services, Docker projects, ports, and setup commands.
  • Clarify in the MCP schema that an update replaces the full definition and omitted fields are deleted.
  • Add focused workflow and tool-schema regression assertions plus a patch changeset.

Impact

Agent-authored environment revisions now preserve unrelated configuration instead of rebuilding a partial replacement. Intentional removals remain possible when they are part of the requested or evidence-backed change.

How it was tested

  • 19 focused cloud-agent environment setup workflow assertions passed.
  • 42 focused worker MCP tool-description assertions passed.
  • Type checks passed for @roomote/cloud-agents and @roomote/worker.
  • Repository pre-push lint, fast type checks, and Knip checks passed.
  • Browser proof is not applicable because the change affects agent guidance and MCP schema text, not a rendered UI.

Checklist

  • The PR title follows the repo convention: [Fix], [Feat], [Improve], [Refactor], [Docs], or [Chore] followed by a user-facing description
  • This PR is small and scoped to one change
  • pnpm lint and pnpm check-types pass locally (the repository pre-push equivalents and affected-package full type checks passed)
  • I added tests or included a clear manual validation note above
  • I removed secrets, tokens, private keys, and customer data from code, logs, and screenshots
  • If this change should appear in the changelog, I ran pnpm changeset (an equivalent package-scoped patch changeset was added directly)

@roomote-community

roomote-community Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

1 issue outstanding. See task

  • Existing-environment updates without a supplied complete definition can still delete hidden settings (packages/cloud-agents/src/server/workflows/skills/standard/environment-setup/SKILL.md:92).

Reviewed 2475b9a

<description>Create the smallest valid Roomote environment YAML from static evidence.</description>
<actions>
<action>Produce exactly one initial YAML config.</action>
<action>For an existing environment, start from its complete current definition and apply only the requested or validation-backed changes. Preserve every unrelated field verbatim, especially `agentInstructions`, `skills`, `manualSkills`, environment variables, MCP servers, services, Docker projects, ports, and setup commands. The update API replaces the full definition, so an omitted field is a deletion; never regenerate an existing definition from repository evidence alone.</action>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only protects update tasks that are explicitly given the complete YAML. A task launched inside an existing environment receives sanitizeEnvironmentConfigForPrompt, which deliberately omits env, agentInstructions, skills, manualSkills, and MCP-server settings; manage_environments has no read action, and list_environments returns only ID/name/description. Such a task therefore cannot build the required baseline, but handleUpdateEnvironment will still replace the config if it submits the visible partial definition, deleting the omitted fields. Add a fail-closed path when the complete definition is unavailable (or expose a safe retrieval path) and cover that flow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant